/*
* $Id: JournalTreeView.h 340 2011-10-20 08:08:01Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _JOURNAL_TREE_VIEW_H_
#define _JOURNAL_TREE_VIEW_H_

#include "Components/Journal/JournalView.h"
#include "JournalTab.h"
#include "NavigationWin.h"
#include "State.h"
#include "ViewJournalFactory.h"

interface IViewJournal;

class CJournalTreeView : public CJournalView
{
	CViewJornalFactory m_viewFactory;
	CJournalTabCtrl m_tabCtrl;
	CNavigationWin m_NavigationWin;
	IViewJournal* m_pViewJornal;
	CSize m_sizeWin;
	CState m_state;
protected:
	void SelChange();
	void ChangeState(State state);
	void ItemManipulation(Journal::typeItemMnpl type, int param);
protected:
	DECLARE_MESSAGE_HANDLER();
	bool OnSetFocus(HWND hWnd);
	bool OnSize(unsigned int code, int width, int height);
	long OnItemManipulation(unsigned int wParam, long lParam);
	bool OnTabSelChange(LPNMHDR pInfo);
	bool OnTreeSelChange(LPNMHDR pInfo);
	bool OnEndItemEdit(LPNMHDR pInfo);
public:
	CJournalTreeView();
	virtual ~CJournalTreeView();
public:
	virtual void CreateView(int hwnd);
};

#endif/*_JOURNAL_TREE_VIEW_H_*/